{% load i18n lfs_tags %}
{% if products %}
    <table id="livesearch-results-table">
        {% for product in products %}
            <tr class="{% cycle 'even' 'odd' %}"
                onclick="window.location='{{ product.get_absolute_url }}'">
                <td class="image">
                    {% if product.get_image %}
                        <a href="{{ product.get_absolute_url }}">
                            <img src="{{ product.get_image.image.url_60x60 }}"
                                 alt="{{ product.get_name }}"
                                 title="{{ product.get_name }}" />
                        </a>
                    {% endif %}
                </td>
                <td class="text">
                    <a href="{{ product.get_absolute_url }}">
                        {{ product.get_name }}
                    </a>
                    {% for property in product.get_variant_properties %}
                        <div>
                            {{ property.title }} : {{ property.value }} {{ property.unit|safe }}
                        </div>
                    {% endfor %}

                    {% for property in product.get_displayed_properties %}
                        <div>
                            {{ property.title }} : {{ property.value }} {{ property.unit|safe }}
                        </div>
                    {% endfor %}
                </td>
                <td class="number"
                    nowrap="nowrap">
                    <div class="price">
                        {{ product|get_price_gross:request|currency:request}}* {% if product.get_price_unit %}/ {{ product.get_price_unit }}{% endif %}
                    </div>
                    {% if product.active_base_price %}
                        <div class="base-price">
                            {{ product|get_base_price_gross:request|currency:request}}* {% if product.get_base_price_unit %}/ {{ product.get_base_price_unit }}{% endif %}
                        </div>
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        <tr>
            <td class="all-results"
                colspan="3">
                <a href="{% url lfs_search %}?q={{ q }}">
                    {% trans 'All results' %} ({{ total }})
                </a>
            </td>
        </tr>
    </table>
{% else %}
    <p>{% trans 'No products found' %}</p>
{% endif %}
